---
title: dub.analytics.clicks.cities
sidebarTitle: Cities
description: Retrieve the top cities by number of clicks for a link, a domain, or the authenticated workspace.
---

import AnalyticsArguments from "/snippets/analytics-arguments.mdx";

<Note>
  Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
  higher.
</Note>

<AnalyticsArguments />

## Response

<ResponseField name="city" type="string" required>
  The name of the city
</ResponseField>

<ResponseField name="country" type="string" required>
  The 2-letter country code: [https://d.to/geo](https://d.to/geo)
</ResponseField>

<ResponseField name="clicks" type="number" required>
  The number of clicks from this city
</ResponseField>

<RequestExample>

```typescript
await dub.analytics.clicks.cities({
  key: "dummy",
  domain: "dub.sh",
  interval: "30d",
});
```

</RequestExample>

<ResponseExample>

```typescript
[
  { city: "San Francisco", country: "US", clicks: 18 },
  { city: "Lviv", country: "UA", clicks: 1 },
];
```

</ResponseExample>
